// components/header/index.js

const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    nickName: '',
    isLogin: true
  },
  
  /**
   * 组件的方法列表
   */
  methods: {
    bindGetUserInfo(e) {
      console.log(e.detail.userInfo)
      let userInfo = e.detail.userInfo;
      this.setData({
        userImg: userInfo.avatarUrl,
        nickName: userInfo.nickName
      })
    },
    getUserInfo: function (e) {
      console.log(e)
      // app.globalData.userInfo = e.detail.userInfo
      let user = e.detail.userInfo
      this.setData({
        userInfo: user,
        hasUserInfo: true,
        isLogin: false
      })
    }
  }
})
